Skip to content

Keep the keyboard up while the composer sheet changes above its field - #81

Merged
simonhamp merged 1 commit into
mainfrom
fix/sheet-keyboard
Oct 23, 2026
Merged

simonhamp merged 1 commit into
mainfrom
fix/sheet-keyboard

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Typing the first character into the composer sheet dropped the keyboard.

EDGE gives every node without a native:key the next number from a counter, in the order the tree is drawn, and iOS and Android treat a new id as a new view. The Commit check is 2 nodes while it's disabled and 3 once it's enabled, because it gains a pressable wrapper. So as soon as the draft could be committed, every id below the button moved by one, the field was rebuilt, and the keyboard went with the old one. autofocus doesn't bring it back because it only fires the first time a field appears. The /feature badge, the sheet's error text and the error or "couldn't refresh" banners behind the sheet did the same.

This keys the bottom sheet and its field. Inside a keyed node, unkeyed children are numbered by their position within it, so the sheet's key covers the Commit button and the banners, and the field's key covers the badge and the error text that sit above it in its own column. With only the sheet keyed the badge case still fails.

The new test in ComposeSheetTest checks that every id from the root down to sheet-body stays the same through each of those changes. It fails without the keys.

I also checked the commit page's Reply bar and the Remotes composer, which looked like the same setup. They aren't affected, because NativeComponent::resolveBottomBar lifts a screen's bottom-bar to the root ahead of the page, so nothing on the page can move its ids. The tests added to CommitDetailTest and ConversationTest passed before this change. They're there to catch it if that ever stops being true, and can go if you'd rather not have them.

Tests: the full suite passes (1196) on main's lock. I haven't tried it on a phone yet.

🤖 Generated with Claude Code

EDGE numbers unkeyed nodes in the order they're drawn, and iOS and
Android treat a new id as a new view. Typing the first character turned
Commit on, which wraps its circle in a pressable and adds a node above
the field. Every id after it moved, so the field was rebuilt and the
keyboard went down. The issue badge and the error and refresh banners
above the sheet did the same.

Keying the sheet and its field keeps the field's id stable. Tests check
the ids from the root to the field stay put in each case, and that the
Reply bar and the Remotes composer (already safe, since bottom bars are
hoisted ahead of the page) stay that way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit 9495e33 into main Oct 23, 2026
1 check passed
@simonhamp
simonhamp deleted the fix/sheet-keyboard branch October 23, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant